package com.example.my_project_test.mybatis.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.my_project_test.mybatis.entity.Person;
import com.example.my_project_test.mybatis.mapper.PersonMapper;
import com.example.my_project_test.mybatis.service.PersonService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author cenjinxing
 * @Description: 该类的功能描述
 * @date: 2022/5/11 09:50
 */
@Service
public class PersonServiceImpl implements PersonService {
    @Resource
    private PersonMapper personMapper;

    @Override
    public Person getPerson(String id) {
        QueryWrapper<Person> wrapper = new QueryWrapper<>();
        wrapper.eq("id",id);
        wrapper.eq("is_del",0);
        Person person = personMapper.selectOne(wrapper);
        System.out.println("person = " + person);
        return person;
    }
}
